﻿using System.ComponentModel.DataAnnotations;

namespace WH.Contracts.Systems.KeyValues
{
    /// <summary>
    /// 
    /// </summary>
    public class KeyValueInputDto
    {
        /// <summary>
        /// 父节点id 默认为0位顶节点
        /// 默认值:
        /// </summary>
        [Required(ErrorMessage = "父节点id不能为空")]
        [MaxLength(50, ErrorMessage = "父节点id最大长度为50")]
        public string ParentId { get; set; } = null!;

        /// <summary>
        /// 类型编号
        /// 默认值:
        /// </summary>
        [Required(ErrorMessage = "类型编号不能为空")]
        [MaxLength(255, ErrorMessage = "类型编号最大长度为50")]
        public string Code { get; set; } = null!;

        /// <summary>
        /// 类型名称
        /// 默认值:
        /// </summary>
        [Required(ErrorMessage = "类型名称不能为空")]
        [MaxLength(50, ErrorMessage = "类型名称最大长度为50")]
        public string Name { get; set; } = null!;
        /// <summary>
        /// 类型图标
        /// 默认值:
        /// </summary>
        [MaxLength(255, ErrorMessage = "类型图标最大长度为255")]
        public string? IconUrl { get; set; } = string.Empty;


        /// <summary>
        /// 输入码
        /// 默认值:
        /// </summary>
        [MaxLength(50, ErrorMessage = "输入码最大长度为50")]
        public string? InputCode { get; set; } = string.Empty;

        /// <summary>
        /// 排序码
        /// </summary>
        //[MaxLength(11, ErrorMessage = "排序码最大长度为50")]
        public int SortCode { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnable { get; set; }

    }
}
